﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="CustomerContactSystem.Core" namespace="CustomerContactSystem.Core.Model">
  <class name="EnquiryReferral" table="EnquiryReferrals">
    <id name="Id">
      <generator class="native" />
    </id>
    <many-to-one name="Enquiry" class="Enquiry" not-null="true" foreign-key="FK_EnquiryReferrals_Enquiries"></many-to-one>
    <property name="DateReferred" not-null="true" />
    <many-to-one name="ReferredTo" class="User" column="ReferredToId" not-null="true" lazy="false" fetch="join" foreign-key="FK_EnquiryReferrals_Users"></many-to-one>
    <many-to-one name="ReferredToDepartment" class="Department" column="ReferredToDepartmentId" not-null="true" lazy="false" fetch="join" foreign-key="FK_EnquiryReferrals_Departments"></many-to-one>
    <many-to-one name="ReferredToGroup" class="UserGroup" column="ReferredToGroupId" not-null="true" lazy="false" fetch="join" foreign-key="FK_EnquiryReferrals_UserGroups"></many-to-one>
  </class>
</hibernate-mapping>